﻿<%@ Page Title="" Language="C#" MasterPageFile="~/glymb.Master" AutoEventWireup="true" CodeBehind="gldd.aspx.cs" Inherits="ShoppingWebSite.gldd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="css/ShopSite.css" rel="stylesheet" />
     <style>
         #Content{
            width:500px;
            margin:0px auto;
            padding-bottom:30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="Content">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="OId" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="OId" HeaderText="订单编号" InsertVisible="False" ReadOnly="True" SortExpression="OId" />
            <asp:BoundField DataField="OUserId" HeaderText="用户id" SortExpression="OUserId" />
            <asp:BoundField DataField="OProductId" HeaderText="商品价格" SortExpression="OProductId" />
            <asp:BoundField DataField="OTime" HeaderText="购买时间" SortExpression="OTime" />
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ShoppingDBConnectionString6 %>" DeleteCommand="DELETE FROM [Order] WHERE [OId] = @OId" InsertCommand="INSERT INTO [Order] ([OUserId], [OProductId], [OTime], [OState], [OInfo]) VALUES (@OUserId, @OProductId, @OTime, @OState, @OInfo)" SelectCommand="SELECT * FROM [Order]" UpdateCommand="UPDATE [Order] SET [OUserId] = @OUserId, [OProductId] = @OProductId, [OTime] = @OTime, [OState] = @OState, [OInfo] = @OInfo WHERE [OId] = @OId">
        <DeleteParameters>
            <asp:Parameter Name="OId" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="OUserId" Type="Int32" />
            <asp:Parameter Name="OProductId" Type="Int32" />
            <asp:Parameter Name="OTime" Type="DateTime" />
            <asp:Parameter Name="OState" Type="Int32" />
            <asp:Parameter Name="OInfo" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="OUserId" Type="Int32" />
            <asp:Parameter Name="OProductId" Type="Int32" />
            <asp:Parameter Name="OTime" Type="DateTime" />
            <asp:Parameter Name="OState" Type="Int32" />
            <asp:Parameter Name="OInfo" Type="String" />
            <asp:Parameter Name="OId" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
        </div>
</asp:Content>
